home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 11
/
CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso
/
s
/
groupscale.pprx
< prev
next >
Wrap
Text File
|
1992-03-14
|
2KB
|
115 lines
/*
@BGroupScale @P@ICopyright Gold Disk Inc., February, 1992
This Genie will scale a group of boxes. Enter values as a percentage of the current dimensions.
*/
parse arg xratio, yratio
address command
cr = '0a'x
numbers = "1234567890."
call SafeEndEdit.rexx()
call ppm_AutoUpdate(0)
units = ppm_GetUnits()
if units = 3 then
call ppm_SetUnits(1)
signal on halt
signal on break_c
signal on break_e
signal on break_d
box = ppm_GroupFirstBox()
if box = 0 then exit_msg("Select group of boxes first")
if xratio = '' | yratio = '' then
do
form = "Width %"cr"Height %"
form = ppm_GetForm("Select Scaling Options", 8, form)
if form = '' then exit_msg()
parse var form width '0a'x height
end
else
do
if words(xratio) = 2 then
do
width = word(xratio, 1)
height = word(xratio, 2)
end
else
do
width = xratio
height = yratio
end
end
if width = '' then
width = 100
else
width = strip(width)
if height = '' then
height = 100
else
height = strip(height)
if verify(width||height, numbers) ~= 0 | width < 1 | height < 1 then exit_msg("Invalid Entry")
grprect = ppm_GetGroupRect()
grpleft = word(grprect, 1)
grptop = word(grprect, 2)
width = width / 100
height = height / 100
call ppm_ShowStatus("Working..")
boxtypes = "EMPTYTEXT"
do while box ~= 0
boxsize = ppm_GetBoxSize(box)
boxpos = ppm_GetBoxPosition(box)
boxleft = word(boxpos, 1)
boxtop = word(boxpos, 2)
boxwidth = word(boxsize, 1) * width
boxheight = word(boxsize, 2) * height
call ppm_SetBoxSize(box, boxwidth, boxheight)
xoffset = (boxleft - grpleft) * width + grpleft
yoffset = (boxtop - grptop) * height + grptop
call ppm_SetBoxPosition(box, xoffset, yoffset)
if verify(upper(word(ppm_GetBoxInfo(box), 1)), boxtypes) ~= 0 then
do
boxscale = ppm_GetBoxScale(box)
call ppm_SetBoxScale(box,width*word(boxscale,1),height * word(boxscale, 2))
offset = ppm_GetBoxOffset(box)
call ppm_SetBoxOffset(box,width * word(offset,1),height * word(offset, 2))
end
box = ppm_GroupNextBox(box)
end
exit_msg()
break_d:
break_e:
break_c:
halt:
call exit_msg("User aborted Genie!")
exit_msg: procedure expose units
do
parse arg message
if message ~= '' then
call ppm_Inform(1,message,)
if units = 3 then call ppm_SetUnits(3)
call ppm_ClearStatus()
call ppm_AutoUpdate(1)
exit
end